#include <hardware/relay/relay.h>

void INIT_RELAY()
{
    pinMode(RELAY, OUTPUT);
    RELAY_OFF();
}

void RELAY_ON()
{
    digitalWrite(RELAY, LOW);
}

void RELAY_OFF()
{
    digitalWrite(RELAY, HIGH);
}

void SET_RELAY_STATE(unsigned char value)
{
    relayState = value;
    return;
}

void SWITCH_RELAY()
{
    if (relayState == 1)
    {
        RELAY_ON();
    }
    else
    {
        RELAY_OFF();
    }
}